package com.jdym.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jdym.R;
import com.jdym.entity.Integral;
import com.jdym.service.IntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/integral")
public class IntegralController {
    @Autowired
    IntegralService integralService;

    @RequestMapping("/getIntergralById/{firmId}")
    public R getIntergralById(@PathVariable int firmId){
        Integral integral=integralService.getBaseMapper().selectOne(new QueryWrapper<Integral>().eq("firm_id",firmId));
        return R.ok().data("integral",integral);
    }
}
